
#include <boost/python.hpp>
#include <boost/python/enum.hpp>
#include <boost/python/def.hpp>
#include <boost/python/module.hpp>
#include <libtorrent/seedbank/mongodb_alert_code.hpp>
#include <libtorrent/seedbank/mongodb_torrent_db.hpp>

using namespace boost::python;
using namespace libtorrent;

namespace
{
    boost::shared_ptr<plugin> create_mongodb_torrent_db_plugin_wrapper(string_map const& param_map) {
        return create_mongodb_torrent_db_plugin(param_map);
    }
}

void bind_mongodb_torrent_db()
{
    using boost::noncopyable;
    {
        enum_<mongodb_alert_code::code_t>("mongodb_alert_code")
            .value("db_connect_ok", mongodb_alert_code::db_connect_ok)
            .value("torrent_activated", mongodb_alert_code::torrent_activated)
            .value("torrent_not_found", mongodb_alert_code::torrent_not_found)
            .value("unclassified_error", mongodb_alert_code::unclassified_error)
            .value("db_connect_error", mongodb_alert_code::db_connect_error)
            .value("db_connection_failed", mongodb_alert_code::db_connection_failed)
            .value("invalid_torrent_file", mongodb_alert_code::invalid_torrent_file)
            .export_values()
            ;
    }

    def("create_mongodb_torrent_db_plugin", create_mongodb_torrent_db_plugin_wrapper);

}
